<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateAboutMesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('about_mes', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100)->comment("名称");
            $table->string('avatar', 100)->comment("头像");
            $table->tinyInteger('gender')->default(0)->comment("性别 1：男 2：女");
            $table->string('age', 20)->default("90后")->comment("年龄");
            $table->string('github_url', 150)->nullable()->comment("github地址");
            $table->string('gitee_url', 150)->nullable()->comment("码云地址");
            $table->string('weichat', 150)->nullable()->comment("微信地址");
            $table->text('content')->comment("介绍内容");
            $table->timestamp('created_at')->useCurrent()->comment('创建时间');
            $table->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))->comment('更新时间');
        });
        DB::statement("ALTER TABLE ". env("DB_PREFIX") ."about_mes comment '项目类型表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('about_mes');
    }
}
